package com.yhb.channel.impl.SXY.ResponseParser.impl;

import com.yhb.channel.impl.SXY.ResponseParser.SXYResponseParser;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class RemitResponse extends SXYResponseParser {

    public enum OrderStatus {
        INIT,
        SUCCESS,
        FAIL,
        FAILED,
        PROCESS
    }
    private String orderId;
    private OrderStatus orderStatus; // 打款状态
    private Status status;
    private String receiveAmount; // 实际到账金额
    private String fee; // 收取用户的总手续费
    private String amount; // 出款金额
    private String accountName; // 收款人姓名
    private String bankCardNumber; // 收款人银行卡号
    private String remark; // 出款订单备注

    @Override
    public boolean isOk() {
        boolean orderIsOk = OrderStatus.INIT.equals(this.orderStatus) ||
                OrderStatus.SUCCESS.equals(this.orderStatus) ||
                OrderStatus.PROCESS.equals(this.orderStatus);
        return Status.SUCCESS.equals(this.status) && orderIsOk;
    }
}
